#include "KevinSlider.h"
#include "./ui_KevinSlider.h"

#include <QDebug>

KevinSlider::KevinSlider(QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::KevinSlider) {
    ui->setupUi(this);
    void (QSpinBox::*signal)(int) = QSpinBox::valueChanged;

    connect(ui->spinBox, signal, ui->horizontalSlider, &QSlider::setValue);
    connect(ui->horizontalSlider, &QSlider::valueChanged, ui->spinBox, &QSpinBox::setValue);
}
KevinSlider::~KevinSlider() {
    delete ui;
}
void KevinSlider::study() {
}

void KevinSlider::setValue(int value) {
    qDebug() << QString("  KevinSlider::setValue(%1)").arg(value);
    ui->spinBox->setValue(value);
}

int KevinSlider::getValue() {
    qDebug() << "  KevinSlider::getValue() = " << ui->spinBox->value();

    return ui->spinBox->value();
}
